/*
 * Copyright 2008-2023 dexian.vip. All rights reserved.
 * Support: http://www.dexian.vip
 * License: http://www.dexian.vip/license
 */

package vip.dexian.admin.entity;

import vip.dexian.core.base.bean.BaseEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicUpdate;

import java.io.Serial;

/**
 * 角色 -> 部门关联
 *
 * @author 挺好的 2023年06月08日 10:53
 */
@Entity
@Table (name = "br_admin_role_department")
@DynamicUpdate
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
@EqualsAndHashCode (callSuper = true)
public class RoleDepartment extends BaseEntity <Long> {


    @Serial
    private static final long serialVersionUID = -5054144522192625813L;

    /**
     * 部门id
     */
    @Comment ("部门id")
    @Column (nullable = false, updatable = false)
    private Long departmentId;

    /**
     * 部门名称， 冗余数据
     */
    @Comment ("部门名称")
    @Column (nullable = false, length = 20)
    private String departmentName;

    /**
     * 角色id
     */
    @Comment ("角色ID")
    @Column (nullable = false)
    private Long roleId;
}
